import request from '@/utils/request'
import { AxiosPromise } from 'axios'
import { ISamplePermissionItem, PermissionQuery, IPermissionItem } from './types'

/**
 * 获取权限列表数据
 *
 * @param params
 */

export function getPermissionList(params: PermissionQuery): AxiosPromise<PageResult<IPermissionItem[]>> {
  return request({
    url: '/permissions',
    params
  })
}

/**
 * 获取权限简单列表 下拉数据
 */
export function listPermissionOptions(): AxiosPromise<ISamplePermissionItem[]> {
  return request({
    url: '/permissions/simple'
  })
}
